package great.easychat.help.config;

import android.os.Build;

import com.pince.http.DefaultHttpConfig;
import com.pince.http.GzipInterceptor;
import com.pince.renovace2.Util.RenovaceLogUtil;
import com.pince.ut.AppCache;
import com.pince.ut.AppUtil;
import com.pince.ut.OsInfoUtil;
import com.pince.ut.TimeUtil;
import com.pince.ut.constans.FileConstants;

import java.io.IOException;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.TreeMap;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import great.easychat.help.uinque.UUIDUtils;
import okhttp3.Headers;
import okhttp3.Interceptor;
import okhttp3.MultipartBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import okio.Buffer;

/**
 * @author athoucai
 * @date 2018/11/27
 */
public class UploadHttpConfig extends DefaultHttpConfig {

    @Override
    protected String cachePath() {
        return FileConstants.CACHE_NETWORK_DIR;
    }

    @Override
    public OkHttpClient client() {
        OkHttpClient.Builder okHttpClientBuilder = new OkHttpClient.Builder();
        client(okHttpClientBuilder);
        okHttpClientBuilder.retryOnConnectionFailure(true);
        okHttpClientBuilder.connectTimeout(5000, TimeUnit.MILLISECONDS);
        return okHttpClientBuilder.build();
    }

    @Override
    public void client(OkHttpClient.Builder builder) {
        builder.addNetworkInterceptor(new GzipInterceptor());
    }

}
